<style>
.bac-color-f9 {
	background-color: #ff9920;
}
.btn-success{
	background-color: #d8e0e6;
	color: #95a5a6;
    background-color: #d8e0e6;
    border: 1px solid #e8edf0;
	border-radius: 3px;
}
.btn-play{
	background-color: #18bc9c;
	color: #fff;
	border-radius: 3px;
}
.cancel-btn,.detail-btn,.info-btn{
	background-color: #f6f6f6;
	color: #7b7b7b;
	border-radius: 3px;
}
.thisBtnPad{
	padding: 4rpx 8rpx;
}
</style>
<template>
	<view class="order-item mar-t-10 flex flex-column over-hid bac-color-normal pad-10">
		<view class="">
			<view class="font-color-fff font-size-15 tq-text-line1">
				<text>活动名称：{{item.name}}</text>
			</view>
			<view class="font-color-fff font-size-13 mar-t-10 flex align-center justify-between">
				<text>活动时间：{{transformTime(item.start_time)}}</text>
				<text v-if="item.way_text">参与方式：{{item.way_text}}</text>
			</view>
		</view>
		<view class="flex align-center justify-end font-size-13 mar-t-10">
			<block >
				<view class="btn detail-btn mar-l-5 thisBtnPad" @click="detail(item.order_no)">
					<text class="font-size-13">查看详情</text>
				</view>
			</block>
			<block v-if="item.status==1">
				<view class="btn mar-l-5 cancel-btn thisBtnPad" @click="logCancel(item.order_no)">
					<text class="font-size-13">取消报名</text>
				</view>
			</block>
			<block v-if="item.status==1">
				<navigator
					hover-class="none"
					:url="'/pages/activity/join?order_no='+item.order_no"
					class="btn info-btn mar-l-5 thisBtnPad"
				>
					<text class="font-size-13">去报到</text>
				</navigator>
			</block>
			<block v-if="item.status == 2">
				<navigator
					hover-class="none"
					:url="'/pages/activity/evaluate?order_no='+item.order_no+'&type=activity'"
					class="btn yellow-btn mar-l-5 thisBtnPad"
				>
					<text class="font-size-13">去评价</text>
				</navigator>
			</block>
			<block v-if="item.status == 3">
				<view class="btn btn-success mar-l-5 thisBtnPad">
					<text>已完成</text>
				</view>
			</block>
		</view>
	</view>
</template>

<script>
export default {
	props: ['item'],
	methods: {
		logCancel(order_no) {
			let _that = this
			uni.showModal({
				title: '提示',
				content: '真的要取消报名吗',
				success(res) {
					if (res.confirm) {
						_that.$emit('orderCancel', {
							order_no,
							type: 'activity_log'
						})
					}
				}
			})

			// actCancel({ order_no }).then(res => {
			// 	console.log(res)
			// })
		},
		detail(order_no){
			this.href('/pages/order/activity_info?order_no='+order_no)
		}
	}
}
</script>

